{template 'common/header'}
{template 'common'}
<ul class="nav nav-tabs">
    <li {if $operation=='display'} class="active" {/if}>
    <a href="{php echo $this->createWebUrl('qualityorder',array('op' =>'display'))}">精品游订单列表</a>
    </li>
    {if !empty($order['id']) && $operation == 'detail'}
    <li class="active">
        <a href="{php echo $this->createWebUrl('qualityorder',array('op' =>'detail','id'=>$order['id']))}">查看精品游订单</a>
    </li>
    {/if}
</ul>

<!--列表-->
{if $operation == 'display'}
<div class="main panel panel-default">
    <div class="panel-body table-responsive">
        <table class="table table-hover">
            <thead class="navbar-inner">
            <tr>
                <th style="width:30px;">ID</th>
                <th>订单号</th>
                <th>流水号</th>
                <th>支付时间</th>
                <th>支付状态</th>
                <th>联系人姓名</th>
                <th>联系人手机</th>
                <th>名称</th>
                <th>支付金额</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {loop $list $order}
            <tr>
                <td>{$order['id']}</td>
                <td>{$order['order_no']}</td>
                <td>{$order['pay_no']}</td>
                <td>{php echo empty($order['payment_time'])?'':date('Y.m.d',$order['payment_time'])}</td>
                <td>{php echo ($order['status'] == 1)?'已支付':'未支付'}</td>
                <td>{$order['contact_name']}</td>
                <td>{$order['contact_mobile']}</td>
                <td>{$order['name']}</td>
                <td>{php echo number_format($order['total_price'],2)}</td>
                <td style="text-align:left;">
                    <a href="{php echo $this->createWebUrl('qualityorder', array('op' => 'detail', 'id' => $order['id']))}"
                       class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="查看">
                        <i class="fa fa-edit"></i>
                    </a>
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
        {$pager}
    </div>
    `
</div>
<script>
    require(['bootstrap'], function ($) {
        $('.btn').hover(function () {
            $(this).tooltip('show');
        }, function () {
            $(this).tooltip('hide');
        });
    });
</script>

<!--详细-->
{elseif $operation == 'detail'}
<div class="main">
    <div class="panel panel-default">
        <div class="panel-heading">
            精品游订单基本信息
        </div>
        <div class="panel-body form-horizontal">
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    订单号
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['order_no']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    支付单号
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['pay_no']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    支付时间
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{php echo empty($order['payment_time'])?'':date('Y.m.d',$order['payment_time'])}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    支付状态
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{php echo ($order['status'] == 1)?'已支付':'未支付'}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    支付金额
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['total_price']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    汇率
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['exchange_rate']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    精品游名称
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['name']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    成人单价
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['adult_price']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    成人数量
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['adult_number']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    儿童单价
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['child_price']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    儿童数量
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['child_number']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    婴儿单价
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['baby_price']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    婴儿数量
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['baby_number']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    出发时间
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{php echo empty($order['departure_date'])?'':date('Y.m.d',$order['departure_date'])}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    联系人姓名
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['contact_name']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    联系人手机
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['contact_mobile']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    联系人邮箱
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$order['contact_email']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    创建时间
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{php echo date('Y.m.d',$order['created_at']) }" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    sku参数
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$sku['name']}" disabled/>
                </div>
            </div>
        </div>
    </div>
    {if $order['adult_number'] > 0 }
    <div class="panel panel-default">
        <div class="panel-heading">
            成人信息
        </div>
        <div class="panel-body table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th>姓名</th>
                </tr>
                </thead>
                <tbody>
                {loop $order['adult_members'] $adult_members}
                <tr>
                    <td>{$adult_members}</td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
    </div>
    {/if}
    {if $order['child_number'] > 0 }
    <div class="panel panel-default">
        <div class="panel-heading">
            儿童信息
        </div>
        <div class="panel-body table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th>姓名</th>
                </tr>
                </thead>
                <tbody>
                {loop $order['child_members'] $child_members}
                <tr>
                    <td>{$child_members}</td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
    </div>
    {/if}
    {if $order['baby_number'] > 0 }
    <div class="panel panel-default">
        <div class="panel-heading">
            婴儿信息
        </div>
        <div class="panel-body table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th>姓名</th>
                </tr>
                </thead>
                <tbody>
                {loop $order['baby_members'] $baby_members}
                <tr>
                    <td>{$baby_members}</td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
    </div>
    {/if}
</div>
{/if}
{template 'common/footer'}